{template 'phpcms','header'}
<script type="text/javascript" src="images/js/validator.js"></script>
<div id="main">
  <!--位置导航-->
  <div id="position"><a href="">首页</a>留言本</div>
    <div class="search_box"><form method="get" name="search" action="{$M[url]}index.php">
    关键字：
		<input name='keyword' type='text' size='30' value='{$keyword}'>&nbsp;
		<input type="radio" name="srchtype" value="0" {if (!$srchtype)} checked {/if}> 标题 	
		<input type="radio" name="srchtype" value="1" {if ($srchtype==1)} checked {/if}> 内容	
		<input type="radio" name="srchtype" value="2" {if ($srchtype==2)} checked {/if}> 会员
		<input name='submit' type='submit' value='留言搜索'></form>
  </div>
  <div class="tag_menu">
    <ul>
      <li><a href="{$M['url']}index.php">留言本首页</a></li>
      <li class="selected"><a href="{$M[url]}post.php">签写留言</a></li>
    </ul>
  </div>

  <form name="myform" method="post" action="{$M['url']}post.php" onSubmit="return check()">
    <table cellspacing="3" cellpadding="3" class="table_form">
      <tbody>
		<tr>
			<th>&nbsp;头像选择：</th>
			<td colspan="2">{$face}</td>
		</tr>
        <tr>
          <th><font color="red">*</font>&nbsp;姓　名：</th>
          <td colspan="2"><input name="guestbook[username]" type="text" size="25" value="{$_username}" require="true" datatype="require" msg="<font color='red'>姓名不能为空</font>"></td>
        </tr>


        <tr>
          <th><font color="red">*</font>&nbsp;标　题：</th>
			<td colspan="2"><input name="guestbook[title]" type="text" id="guestbook[title]" size="40" require="true" datatype="require" msg="<font color='red'>标题不能为空</font>"></td>
        </tr>

        <tr>
          <th><font color="red">*</font>&nbsp;内　容：<p>最多<strong id="num">{$M['maxcontent']}</strong>个英文字母</p><br /><span id="contentmsg"></span></th>
			<td  colspan="2">
			<textarea name="guestbook[content]" id="content" cols="80" rows="10" require="true" datatype="require" msg="<font color='red'><br>内容不能为空</font>" msgid="contentmsg"></textarea>
			{form::editor('content', 'basic', 550, 400)} </td>
        </tr>
		<!--{if $M['enablecheckcode']}-->
        <tr>
          <th><font color="red">*</font>&nbsp;验证码：</th>
			<td  colspan="2"><input name="checkcodestr" type="text" size="4" require="true" datatype="require" msg="验证码不能为空">
			<img src="checkcode.php" id="checkcode" onClick="this.src='checkcode.php?id='+Math.random()*5;" style="cursor:pointer;" alt="验证码,看不清楚?请点击刷新验证码" align="absmiddle"/></td>
        </tr>
		{/if}
        <tr>
          <th>隐　藏：</th>
			<td  colspan="2"><input type="radio" name="guestbook[hidden]" value="1" style="border:0">是
			<input type="radio" name="guestbook[hidden]" value="0" checked style="border:0">否</td>
        </tr>
        <tr>
          <th class="form_th"><input type="checkbox" name="showdetail" id="showdetail" value="1" class="radio" />
          填写联系方式 </th>        
		  <script language="javascript">
			$('#showdetail').click(function() {
				$('#detail').toggle();
			});
		</script>
          <td></td>
        </tr>
      </tbody>
      <tbody id="detail" style="display:none">
        <tr>
          <th>性　别：</th>
			<td colspan="2"><input type="radio" name="guestbook[gender]"  value="1" checked style="border:0">男
				<input type="radio" name="guestbook[gender]" value="0" style="border:0">女
			</td>
        </tr>
        <tr>
          <th>邮　件：</th>
			<td><input name="guestbook[email]" type="text" id="guestbook[email]" size="25"></td>
        </tr>
        <tr>
          <th>QQ：</th>
			<td><input name="guestbook[qq]" type="text" id="guestbook[qq]" size="25"></td>
        </tr>
        <tr>
          <th>主　页：</th>
			<td><input name="guestbook[homepage]" type="text" id="guestbook[homepage]" size="25"></td>
        </tr>
      </tbody>
      <tbody id="detail" style="display:none">
	<tfoot>
        <tr>
          <th>&nbsp;</th>
          <td><input type="submit" name="dosubmit" value=" 提交 ">
            &nbsp;&nbsp;
            <input type="reset" name="Reset" value=" 重置 "></td>
        </tr>
	</tfoot>
    </table>
  </form>
 </div>
<SCRIPT LANGUAGE="JavaScript">
function FCKeditor_OnComplete( editorInstance )
{
    editorInstance.Events.AttachEvent( 'OnSelectionChange', checknum ) ;
}
function checknum()
{
	var num = {$M['maxcontent']}-FCKeditorAPI.GetInstance('content').GetXHTML().length;
	$('#nmu').html(num);
}

$('form').checkForm(1);
function check()
{
	if(typeof(FCKeditorAPI)!="undefined")
	{
		oEditor= FCKeditorAPI.GetInstance('content');
		if(oEditor)
		{
			var t = oEditor.GetXHTML();
			$('#content').val(t);
		}
	}
	$('form').checkForm(1);
	return true;
}
</SCRIPT>
{template 'phpcms','footer'}